package services

import (
	"gorm.io/gorm"
	"server/global"
	"server/internal/model"
)

var SystemLog = new(systemLog)

type systemLog struct {
	model.SystemLog
}

// GetList 列表
func (a systemLog) GetList(Db *gorm.DB) ([]systemLog, int64) {
	var list []systemLog
	var total int64
	Db.Model(&a).Order("id desc").Find(&list).Offset(-1).Count(&total)
	return list, total
}

// GetById 单条
func (a systemLog) GetById(id any) systemLog {
	Db := global.GL_DB
	detail := systemLog{}
	Db.Model(&a).Where("id =?", id).First(&detail)
	return detail

}
